<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #app {
            background: #fff;
        }
        div,input {
            height: 18px;
            background:#f0f0f0;
        }
        p {
            background: red;
        }
    </style>
    <script src="./js/dep.js"></script>
    <script src="./js/watcher.js"></script>
    <script src="./js/compile.js"></script>
    <script src="./js/observer.js"></script>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        模板msg<br/>
        <div>{{ msg }}</div>
        v-text="msg"<br/>
        <div v-text="msg"></div>
        v-model="msg"<br/>
        <input type="text" v-model="msg">

        <hr>
        模板aaa.bbb<br/>
        <div>{{ aaa.bbb }}</div>
        v-text="aaa.bbb"<br/>
        <div v-text="aaa.bbb"></div>
        v-model="aaa.bbb"<br/>
        <input type="text" v-model="aaa.bbb"><br/>
        <button v-on:click="addAB">aaa.bbb+=1</button>
        <!-- {{aaa.ccc}}<br/>
        <button onclick="vm.$data.aaa.ccc = 'ddd'">新增aaa.ccc = 'dddd'</button> -->

        <hr>
        v-html="domstr"<br/>
        <div v-html="domstr"></div>
    </div>

    <script>
        let data = {
            msg: '这是msg',
            aaa:{
                bbb: '1'
            },
            domstr:"<p>这是p标签</p>"
        }
        let methods = {
            addAB(){
                // console.log(this);
                this.aaa.bbb += 1
            }
        }

        let vm = new Vue({
            el:'#app',
            data,
            methods
        })
    </script>
</body>
</html>